package com.hm.controller;

import com.hm.pojo.HmItem;
import com.hm.pojo.HmItemCat;
import com.hm.serivce.HmItemCatService;
import com.hm.serivce.HmItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(value = "盒马Home接口",tags = "盒马Home接口")
public class HmHomeController {

    @Autowired
    private HmItemCatService hmItemCatService;

    @Autowired
    private HmItemService hmItemService;

    /**
     * 首页商品分类列表前10列
     * @return
     */
    @ApiOperation(value = "首页商品分类列表前10列")
    @RequestMapping(value = "/ShowCatListTop",method = RequestMethod.GET)
    public List<HmItemCat> ShowCatListTop(){
        List<HmItemCat> TopList = hmItemCatService.ShowCatListTop();
        return TopList;
    }

    /**
     * home平价超市接口
     * @return
     */
    @ApiOperation(value = "home平价超市接口")
    @RequestMapping(value = "/ParityItem",method = RequestMethod.GET)
    public List<HmItem> ParityItem(){
        List<HmItem> list = hmItemService.ParityItem();
        return list;
    }

}
